package com.jinkaimen.goodcash.application;

import com.ht.baselibs.application.HTApplication;
import com.ht.baselibs.retrofit.RequestUtils;
import com.ht.baselibs.retrofit.converter.fastjson.FastJsonResponseBodyConverter;
import com.iflytek.cloud.SpeechConstant;
import com.iflytek.cloud.SpeechUtility;
import com.jinkaimen.goodcash.constant.HttpConfig;
import com.jinkaimen.goodcash.http.ParameterInterceptor;
import com.umeng.analytics.MobclickAgent;

import java.util.HashMap;

public class AppApplication extends HTApplication {
    public static HashMap<String, Object> tempMap;
    @Override
    public void onCreate() {
        super.onCreate();
        tempMap = new HashMap<>();
        MobclickAgent.setCatchUncaughtExceptions(!IS_DEBUG_MODE);
        SpeechUtility.createUtility(this, SpeechConstant.APPID +"=586db9ce");

        RequestUtils.initInterceptors(new ParameterInterceptor());
    }

    @Override
    protected boolean isDebugMode() {
        return true;
    }

    @Override
    protected String getHost() {
        return HttpConfig.BASE_URL;
    }

    @Override
    protected FastJsonResponseBodyConverter.DecodeService getDecodeService() {
        return null;
    }

    public static Object getTempData(String key) {
        return tempMap.get(key);
    }

    public static void putTempData(String key,Object value){
        tempMap.put(key,value);
    }
}
